package io.admin.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.admin.modules.sys.dao.ComprehensiveTestingDao;
import io.admin.modules.sys.dto.ComprehensiveTestingDTO;
import io.admin.modules.sys.entity.ComprehensiveTestingEntity;
import io.admin.modules.sys.service.ComprehensiveTestingService;
import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 综测数据表
 *
 * @author BS #
 * @since 1.0.0 2024-04-28
 */
@Service
public class ComprehensiveTestingServiceImpl extends CrudServiceImpl<ComprehensiveTestingDao, ComprehensiveTestingEntity, ComprehensiveTestingDTO> implements ComprehensiveTestingService {

    @Override
    public QueryWrapper<ComprehensiveTestingEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        String name = (String)params.get("name");

        QueryWrapper<ComprehensiveTestingEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
        wrapper.eq(StrUtil.isNotBlank(name), "stu_name", name);

        return wrapper;
    }


}